package com.ctg.itrdc.sysmgr.portal.api.dto;

import java.sql.Timestamp;
import java.util.List;

import org.hibernate.validator.constraints.NotBlank;

public class FuncMenuDTO extends BaseDTO implements
		Comparable<FuncMenuDTO> {

	private Boolean hadComp;

	public Boolean getHadComp() {
		return hadComp;
	}

	public void setHadComp(Boolean hadComp) {
		this.hadComp = hadComp;
	}

	private Long privGrantId;

	public Long getPrivGrantId() {
		return privGrantId;
	}

	public void setPrivGrantId(Long privGrantId) {
		this.privGrantId = privGrantId;
	}

	private Boolean hadPriv;

	public Boolean getHadPriv() {
		return hadPriv;
	}

	public void setHadPriv(Boolean hadPriv) {
		this.hadPriv = hadPriv;
	}

	private Long privId;

	public Long getPrivId() {
		return privId;
	}

	public void setPrivId(Long privId) {
		this.privId = privId;
	}

	private Boolean hasChildren;

	public Boolean getHasChildren() {
		return hasChildren;
	}

	public void setHasChildren(Boolean hasChildren) {
		this.hasChildren = hasChildren;
	}

	private String fold = "";
	private String icon = "";
	private List<FuncMenuDTO> item;

	public List<FuncMenuDTO> getItem() {
		return item;
	}

	public void setItem(List<FuncMenuDTO> item) {
		this.item = item;
	}

	public String getFold() {
		return fold;
	}

	public void setFold(String fold) {
		this.fold = fold;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	/**
	 * 菜单标识，主键
	 */
	private Long menuId;

	/**
	 * 菜单类型,LOVB,分为：非功能、功能
	 */
	private String menuType;

	/**
	 * 菜单描述
	 */
	private String menuDesc;

	/**
	 * 修改时间
	 */
	private Timestamp updateDate;

	/**
	 * 菜单项级别(从0开始)
	 */
	private Integer menuLevel;

	/**
	 * 对应模块标识，菜单类型为“非功能”型时，为0
	 */
	private Integer modId;

	/**
	 * 菜单排序号（从0开始）
	 */
	private Integer menuIndex;

	/**
	 * 状态时间
	 */
	private Timestamp statusDate;

	/**
	 * 创建人
	 */
	private Long createStaff;

	/**
	 * 菜单URL链接地址
	 */
//	@NotBlank
	private String urlAddr;

	/**
	 * 修改人
	 */
	private Long updateStaff;

	/**
	 * 创建时间
	 */
	private Timestamp createDate;

	/**
	 * 上级菜单标识
	 */
	private Long parMenuId;

	/**
	 * 系统用户的归属系统
	 */
	@NotBlank
	private String sysCode;

	/**
	 * 主要用于数据管控，标识该配置管理范围
	 */
	private Long tenantId;

	/**
	 * 公用管理区域标识,记录区域唯一标识
	 */
	private Long commonRegionId;

	/**
	 * 菜单名称
	 */
	@NotBlank
	private String menuName;

	/**
	 * 菜单状态
	 */
	@NotBlank
	private String statusCd;
	
	private String openMode;
	
	public String getOpenMode() {
		return openMode;
	}

	public void setOpenMode(String openMode) {
		this.openMode = openMode;
	}

	public void setMenuId(Long menuId) {
		this.menuId = menuId;
	}

	public Long getMenuId() {
		return this.menuId;
	}

	public void setMenuType(String menuType) {
		this.menuType = menuType;
	}

	public String getMenuType() {
		return this.menuType;
	}

	public void setMenuDesc(String menuDesc) {
		this.menuDesc = menuDesc;
	}

	public String getMenuDesc() {
		return this.menuDesc;
	}

	public void setUpdateDate(Timestamp updateDate) {
		this.updateDate = updateDate;
	}

	public Timestamp getUpdateDate() {
		return this.updateDate;
	}

	public void setMenuLevel(Integer menuLevel) {
		this.menuLevel = menuLevel;
	}

	public Integer getMenuLevel() {
		return this.menuLevel;
	}

	public void setModId(Integer modId) {
		this.modId = modId;
	}

	public Integer getModId() {
		return this.modId;
	}

	public void setMenuIndex(Integer menuIndex) {
		this.menuIndex = menuIndex;
	}

	public Integer getMenuIndex() {
		return this.menuIndex;
	}

	public void setStatusDate(Timestamp statusDate) {
		this.statusDate = statusDate;
	}

	public Timestamp getStatusDate() {
		return this.statusDate;
	}

	public void setCreateStaff(Long createStaff) {
		this.createStaff = createStaff;
	}

	public Long getCreateStaff() {
		return this.createStaff;
	}

	public void setUrlAddr(String urlAddr) {
		this.urlAddr = urlAddr;
	}

	public String getUrlAddr() {
		return this.urlAddr;
	}

	public void setUpdateStaff(Long updateStaff) {
		this.updateStaff = updateStaff;
	}

	public Long getUpdateStaff() {
		return this.updateStaff;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setParMenuId(Long parMenuId) {
		this.parMenuId = parMenuId;
	}

	public Long getParMenuId() {
		return this.parMenuId;
	}

	public void setSysCode(String sysCode) {
		this.sysCode = sysCode;
	}

	public String getSysCode() {
		return this.sysCode;
	}

	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	public Long getTenantId() {
		return this.tenantId;
	}

	public void setCommonRegionId(Long commonRegionId) {
		this.commonRegionId = commonRegionId;
	}

	public Long getCommonRegionId() {
		return this.commonRegionId;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getMenuName() {
		return this.menuName;
	}

	public void setStatusCd(String statusCd) {
		this.statusCd = statusCd;
	}

	public String getStatusCd() {
		return this.statusCd;
	}
	
	public Long getId() {
		return menuId;
	}
	
	public void setId(Long id) {
		this.menuId = id;
	}

	@Override
	public int compareTo(FuncMenuDTO o) {
		if(this.menuIndex==o.getMenuIndex()){
			return (int) (this.menuId - o.getMenuId());
		}
		return (this.menuIndex == null ? 0 : this.menuIndex)
				- (o.getMenuIndex() == null ? 0 : o.getMenuIndex());
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof FuncMenuDTO)) {
			return false;
		}
		FuncMenuDTO rhs = (FuncMenuDTO) object;
		return new org.apache.commons.lang3.builder.EqualsBuilder().append(
				this.menuId, rhs.menuId).isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new org.apache.commons.lang3.builder.HashCodeBuilder(1773715331,
				-799713879).append(this.menuId).toHashCode();
	}

}
